﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class CongressManage_MeetingRead : System.Web.UI.Page
{
    public string Personnel;
    public string Types;
    public string Expenditure;
    public string StartTime;
    public string FinishTime;
    public string MeetingContent;
    public string addTime;
    public string UserName;
    public string BoardroomName;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int Meetingid = Convert.ToInt32(Request["Meetingid"].ToString());
            SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);
            con.Open();
            string sql = "select * from MyMeeting where Meetingid=" + Meetingid + "";
            SqlCommand com = new SqlCommand(sql,con);
            SqlDataReader dr = com.ExecuteReader();
            if (dr.Read())
            {
                
                Title = dr["title"].ToString();
                Personnel = dr["Personnel"].ToString();
                Types=dr["Type"].ToString();
                Expenditure = dr["Expenditure"].ToString();
                StartTime = dr["StartTime"].ToString();
                FinishTime = dr["FinishTime"].ToString();
                MeetingContent = dr["MeetingContent"].ToString();
                addTime = dr["addTime"].ToString();
                BoardroomName = dr["BoardroomName"].ToString();

                UserName = SelectName();
            }
            con.Close();
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("MeetingListD.aspx");
    }
    public string SelectName()
    {
        int Meetingid = Convert.ToInt32(Request["Meetingid"].ToString());
        SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);
        con.Open();
        string sql = "select Name from Employee where UserName=(select username from myMeeting where Meetingid="+Meetingid+"  )";
        SqlCommand com = new SqlCommand(sql,con);
        SqlDataReader dr = com.ExecuteReader();
        dr.Read();
        string Name = dr.GetValue(0).ToString();
        return Name;

    }
}
